<template>
	<view class="flex-dc-ac content">
		<image class="zuan" src="../../static/user/zuan.png" mode="widthFix" style="height: auto;"></image>
		<text class="title f40 bold">会员充值成功</text>
		<view class="list">
			<view class="item f26">
				<text>充值类型：</text>
				<text>{{dataObj.name}}</text>
			</view>
			<view class="item f26">
				<text>有效期截止：</text>
				<text>{{userInfo.vipTime}}</text>
			</view>
			<view class="item f26">
				<text>充值金额：</text>
				<text class="cred">￥{{$u.priceFixed(dataObj.money)}}</text>
			</view>
			<view class="item f26">
				<text>充值时间：</text>
				<text v-if="createTime">{{createTime.substr(0,16)}}</text>
			</view>
		</view>
		<view class="saveBtn" @tap="$u.to('/pages/index/index','reLaunch')">返回首页</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				userInfo:{},
				dataObj:{},
				createTime:''
			}
		},
		onLoad(options) {
			this.dataObj = options.obj?JSON.parse(options.obj):{},
			console.log('dataObj',this.dataObj);
			this.getUser()
			this.createTime =this.$u.now('str')
		},
		methods: {
			getUser() {
				this.$http.post('/api/oauth/info').then(res => {
					let result = res.data
					console.log('用户信息', result)
					this.userInfo = result
					this.$u.vuex('vuex_userInfo', result);
				})
			},
		}
	}
</script>

<style lang="less">
.content{
	padding-top: 112rpx;
	.zuan{
		width: 146rpx;
		margin-bottom: 70rpx;
	}
	.list{
		margin-top: 35rpx;
		.item{
			margin-top: 17rpx;
		}
	}
	.saveBtn{
		width: 377rpx;
		height: 64rpx;
		background: linear-gradient( 180deg, #FF7272 0%, #FF0019 100%);
		margin-top: 70rpx;
		font-size: 24rpx;
	}
}
</style>
